<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>Bootstrap, from Twitter</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>

    <!-- Le styles -->
    <link href="/css/bootstrap.css" rel="stylesheet"/>
    <style type="text/css">
        body {
            padding-top: 60px;
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
    <link href="/css/bootstrap-responsive.css" rel="stylesheet"/>

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/ico/apple-touch-icon-144-precomposed.png"/>
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/ico/apple-touch-icon-114-precomposed.png"/>
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/ico/apple-touch-icon-72-precomposed.png"/>
    <link rel="apple-touch-icon-precomposed" href="/ico/apple-touch-icon-57-precomposed.png"/>
    <link rel="shortcut icon" href="/ico/favicon.png"/>
</head>

<body>

<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container-fluid">
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="brand" href="#">Project name</a>
            <div class="nav-collapse collapse">
                <p class="navbar-text pull-right">
                    Logged in as <span th:text="${session.username}">Username</span>
                </p>
                <ul class="nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li><a href="#about">About</a></li>
                    <li><a href="#contact">Contact</a></li>
                </ul>
            </div><!--/.nav-collapse -->
        </div>
    </div>
</div>

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span3">
            <div class="well sidebar-nav">
                <ul class="nav nav-list">
                    <li class="nav-header">Sidebar</li>
                    <li class="active"><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li class="nav-header">Sidebar</li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li class="nav-header">Sidebar</li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                    <li><a href="#">Link</a></li>
                </ul>
            </div><!--/.well -->
        </div><!--/span-->
        <div class="span9">
            <span>培训管理/报名检索</span><br/><br/>
            <form name="form" action="/signUp/search" method="post">
                <span>培训No.：&nbsp;&nbsp;</span><input type="text" id="trainId" name="trainId"/><br/>
                <span>组织课程名称：&nbsp;</span><input type="text" id="subjects" name="subjects"/><br/>
                <span>授课类型：</span>
                <select id="trainTypeName" name="trainTypeName">
                    <option>新员工培训</option>
                    <option>日语技能</option>
                    <option>管理学初级</option>
                    <option>管理学高级</option>
                    <option>过程体系</option>
                    <option>设计技能</option>
                    <option>编程技能</option>
                    <option>测试技能</option>
                    <option>技术专题</option>
                    <option>其他</option>
                </select><br/>
                <button type="submit" class="btn btn-primary">检索</button>
            </form>
            <br/><br/><br/><br/>
            <div th:if="${not #lists.isEmpty(signUpSearchList)}">
                <table class="table table-condensed">
                    <tr>
                        <th>培训名称</th>
                        <th>实施日</th>
                        <th>授课者</th>
                        <th>操作</th>
                    </tr>
                    <tr th:each="sList : ${signUpSearchList}">
                        <td th:text="${sList.trainTypeName}">培训名称</td>
                        <td th:text="${sList.period}">实施日</td>
                        <td th:text="${sList.directorName}">授课者</td>
                        <td><button type="button" th:id="${sList.trainId}" class="btn" onclick="signUp()">参加</button></td>
                    </tr>
                </table>
            </div>
        </div><!--/span-->
    </div><!--/row-->

    <hr/>

    <footer>
        <p>&copy; Company 2020</p>
    </footer>

</div><!--/.fluid-container-->

<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap-transition.js"></script>
<script src="/js/bootstrap-alert.js"></script>
<script src="/js/bootstrap-modal.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/bootstrap-scrollspy.js"></script>
<script src="/js/bootstrap-tab.js"></script>
<script src="/js/bootstrap-tooltip.js"></script>
<script src="/js/bootstrap-popover.js"></script>
<script src="/js/bootstrap-button.js"></script>
<script src="/js/bootstrap-collapse.js"></script>
<script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-typeahead.js"></script>

<script type="text/javascript">
    function signUp() {
        var trainId = event.target.id;
        $.post("/signUp/submit",{"trainId":trainId},function () {},"json");
        $(this).parent().remove();
    }
</script>
</body>
</html>